<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./WEB-INF/includes/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="metadata">
        <f:metadata>
            <f:event type="preRenderView" listener="#{equipmentBacking.init()}"/>
	</f:metadata>
    </ui:define>
    <ui:define name="title">
        设备管理--OfficeBoost System
    </ui:define>

    <ui:define name="content">
        <h:form>
            <font size="3" color="blue">设备信息</font>
             <hr color="#2EA6D7" width="15%" size="2" align="left"/>
            <h:dataTable border="2" value="#{equipmentBacking.equList}" var="equ">
                <h:column >
                    <f:facet name="header">
                        <h:outputText value="设备编号"/>
                    </f:facet>
                    <h:outputText value="#{equ.id}"/>
                </h:column>
                <h:column >
                    <f:facet name="header">
                        <h:outputText value="设备名称"/>
                    </f:facet>
                    <h:outputText value="#{equ.name}"/>
                </h:column>
                <h:column >
                    <f:facet name="header">
                        <h:outputText value="设备用途"/>
                    </f:facet>
                    <h:outputText value="#{equ.theUsage}"/>
                </h:column>
               
                <h:column >
                    <f:facet name="header">
                        <h:outputText value="当前状态"/>
                    </f:facet>
                    <h:outputText value="#{equ.status}"/>
                </h:column>
            </h:dataTable>
              <br/>
              <font size="3" color="blue">设备借用</font>
             <hr color="#2EA6D7" width="15%" size="2" align="left"/>
            <h:panelGrid columns="4">
                <h:outputLabel value="输入编号"/>  
                <h:inputText value="#{equipmentBacking.numtoborrow}" />               
                <h:commandButton value="确定" action="#{equipmentBacking.equBorrow()}" 
                                 onclick="if(!confirm('Are you sure you want to borrow this equipmentt?')) return false"/>
                <h:outputText value="#{equipmentBacking.status}"/>
            </h:panelGrid>
          
                     


        </h:form>

    </ui:define>



</ui:composition>
